<template>
  
  <van-address-list
    v-model="chosenAddressId"
    :list="addressList"
    :disabled-list="disabledList"
    disabled-text="以下地址超出配送范围"
    default-tag-text="默认"
    @add="add()"
  >
  </van-address-list>
</template>

<script setup>
import { userStore } from '@/store/UserStore';
import { computed, ref } from 'vue';
import { useRouter } from 'vue-router';
// import Header from '@/components/Header.vue'; // 引入 Header 组件

const router = useRouter();
const store = userStore();
const addressList = store.addressList;
const disabledList = store.disabledList;
// const chosenAddressId = computed(() => {
//   return store.addressList = forEach((item)=>{
//     if(item.isDefault){
//       return item.id;
//     }
//   })
// });

function add(){
  router.push({
    path:'/UserlnfoEdit',
    query:{
      type:'add'
    }
  })
}
</script>

<style>
.van-address-item__name {
  font-size: 10px;
  color: red;
}
</style>
